package com.cinc.ebc.mm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cinc.ebc.mm.entity.MmPurchaseOrder;
import com.cinc.ebc.mm.model.*;
import com.cinc.ebc.mm.vo.MmPurchaseOrderDetailPage;
import com.cinc.ebc.mm.vo.MmRptPurOrderStatPage;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * @Description: 采购订单
 * @Author: jeecg-boot
 * @Date:   2022-03-20
 * @Version: V1.0
 */
public interface MmPurchaseOrderMapper extends BaseMapper<MmPurchaseOrder> {

    List<MmPurchaseOrderDetailModel> selectDetailList(Page<MmPurchaseOrderDetailModel> page,
                                                      @Param("paramModel") MmPurchaseOrderDetailPage mmPurchaseOrderDetailPage,
                                                      @Param("permissionSql") String permissionSql);

    void deleteLogicById(@Param("id") String id);

    void deleteLogicBatchByIds(@Param("idList") Collection<String> idList);

    List<MmRptPurOrderMaterialStatModel> selectRptMaterialStatList(Page<MmRptPurOrderMaterialStatModel> page, @Param("paramModel") MmRptPurOrderStatPage mmRptPurOrderStatPage);

    MmRptPurOrderMaterialStatTotalModel selectRptMaterialStatTotal(@Param("paramModel") MmRptPurOrderStatPage mmRptPurOrderStatPage);

    List<MmRptPurOrderSupplyStatModel> selectRptSupplyStatList(Page<MmRptPurOrderSupplyStatModel> page, @Param("paramModel")MmRptPurOrderStatPage mmRptPurOrderStatPage);

    MmRptPurOrderSupplyStatTotalModel selectRptSupplyStatTotal(@Param("paramModel") MmRptPurOrderStatPage mmRptPurOrderStatPage);

    List<MmRptPurOrderBuyerStatModel> selectRptBuyerStatList(Page<MmRptPurOrderBuyerStatModel> page, @Param("paramModel")MmRptPurOrderStatPage mmRptPurOrderStatPage);

    MmRptPurOrderBuyerStatTotalModel selectRptBuyerStatTotal(@Param("paramModel") MmRptPurOrderStatPage mmRptPurOrderStatPage);

    BigDecimal selectLatestPriceByMaterialId(@Param("materialId")String materialId, @Param("supplyId")String supplyId);

    List<MmPurchaseOrderSupplyMaterialModel> selectSupplyMaterialStatList(Page<MmPurchaseOrderSupplyMaterialModel> page,
                                                                         @Param("detail") MmPurchaseOrderDetailPage detailPage,
                                                                         @Param("permissionSql") String permissionSql);

}
